package com.xtayfjpk.thrift.test.server;

import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFastFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;

import com.xtayfjpk.thrift.test.service.HelloWorldService;

public class HelloWorldClient {
	public static void main(String[] args) throws Exception {
		
		TTransport transport = new TFastFramedTransport(new TSocket("127.0.0.1", 8090, 60000));
		//TProtocol protocol = new TBinaryProtocol(transport);
		TProtocol protocol = new TCompactProtocol(transport);
		
		HelloWorldService.Client client = new HelloWorldService.Client(protocol);
		transport.open();
		
		String answer = client.sayHello("zhangsan");
		System.out.println(answer);
	}
}
